package negModel;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Clima {
	
	double coef;
	String nombre;
		
	public Clima(double c, String n){
		coef=c;
		nombre=n;
	}
		
	public Clima(Element xmlElement){
		this.coef=Double.parseDouble(xmlElement.getAttribute("coef"));
		this.nombre =xmlElement.getAttribute("nombre");
	}
	
	public Element toXml(Document doc) {
		Element xmlElement = doc.createElement("clima");
		
		xmlElement.setAttribute("coef", ""+ this.coef);
		xmlElement.setAttribute("nombre", this.nombre);
				
		return xmlElement;
	}
	
	public double getCoeficiente(){
		return(coef);
	}

	public String getNombre(){
		return(nombre);
	}

}


